<template>
	<view class="content">
		<view class="image1"><image :src="data" mode="" @click="preview(data)"></image></view>
		<view class="ddd"><button open-type="contact" class="u-reset-button butt" style="width: 100%; height: 100%;">联系客服</button></view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			data: '',
		};
	},
	methods: {
		preview(data) {
			uni.previewImage({
				urls:[data],
				longPressActions: {
					itemList: ['发送给朋友', '保存图片', '收藏'],
					success: function(data) {
						console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
					},
					fail: function(err) {
						console.log(err.errMsg);
					}
				}
			});
		},
		async start() {
			let obj = {};

			const res = await this.$u.post('api/set/customer_service', obj, {});
			this.data = res.data;
			const accountInfo = uni.getAccountInfoSync(); //  获取账号信息同步

			console.log('accountInfo :>> ', accountInfo);
		},
	},

	onLoad() {
		if (!uni.getStorageSync('uid')) {
			uni.navigateTo({
				url: '../logIn/logIn',
			});
		}
		this.start();
	},
};
</script>

<style lang="scss" scoped>
.content {
	width: 100vw;
	height: 100vh;
	overflow: scroll;
	background-color: #1b1b1b;
	.image1 {
		width: 250rpx;
		height: 250rpx;
		// border: 1rpx dashed #CCCCCC;
		border-radius: 20rpx;
		margin: 0 auto;
		margin-top: 450rpx;
		image {
			width: 100%;
			height: 100%;
		}
	}
	.ddd {
		position: absolute;
		left: 50%;
		bottom: 150rpx;
		transform: translateX(-50%);
		width: 670rpx;
		height: 90rpx;
		background: #2a2929;
		border-radius: 10rpx;
		margin: 0 auto;
		display: flex;
		align-items: center;
		color: #ffffff;
		font-size: 35rpx;
		justify-content: center;
		letter-spacing: 10rpx;
	}
	.butt {
		display: flex;
		align-items: center;
		justify-content: center;
	}
}
</style>
